package com.evildog.workspace.system.application.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.evildog.workspace.common.object.PageQuery;
import com.evildog.workspace.common.result.PagedResult;
import com.evildog.workspace.dependencies.mybatis.object.BaseStatusDTO;
import com.evildog.workspace.dependencies.mybatis.object.QueryConditionDTO;
import com.evildog.workspace.system.application.bo.RoleBO;
import com.evildog.workspace.system.application.bo.RoleListBO;
import com.evildog.workspace.system.application.bo.RolePageBO;
import com.evildog.workspace.system.application.bo.RoleUiPermissionBO;
import com.evildog.workspace.system.application.dto.RoleDTO;
import com.evildog.workspace.system.application.dto.RoleListDTO;
import com.evildog.workspace.system.application.dto.RolePageDTO;
import com.evildog.workspace.system.application.dto.RoleUpdateUiPermissionDTO;
import com.evildog.workspace.system.application.entity.ComponentPermission;
import com.evildog.workspace.system.application.entity.MenuPermission;
import com.evildog.workspace.system.application.entity.Role;

import java.util.List;

/**
 * <p>
 * role Service
 * </p>
 *
 * @author evildog
 * @since 2020-07-25
 */
public interface RoleService extends IService<Role> {

    /**
    * 自定义分页
    */
    PagedResult<RolePageBO> getPageList(PageQuery query, List<QueryConditionDTO> queryConditions, RolePageDTO pageDTO);

    /**
    * 获取详情
    */
    RoleBO getDetailById(Long id);

    /**
    * 获取详情
    */
    boolean updateById(Long id, RoleDTO param);

    /**
    * 获取详情
    */
    boolean save(RoleDTO param);

    boolean updateStatus(Long id, BaseStatusDTO convert);

    boolean remove(Long id);

    boolean updateUiPermissions(Long id, RoleUpdateUiPermissionDTO convert);

    RoleUiPermissionBO getAllUiPermissions(Long id);

    /**
     * 获取用户的*可用*菜单
     */
    List<MenuPermission> getMenuPermissions(Long userId);

    /**
     * 获取用户的*可用*菜单
     */
    List<ComponentPermission> getComponentPermissions(Long userId);

    List<RoleListBO> getList(List<QueryConditionDTO> queryCondition, RoleListDTO dto);

    /**
     * 获取用户组关联的可用角色
     */
    List<RoleListBO> getUserRolesByUserGroup(Long userGroupId);

}
